{extend name="public/base" /}

{block name="title"}<title>{$Think.lang.list}</title>{/block}

{block name="pjax_container"}
<div class="hry-content-wrapper">
<section class="content-header">
    <ol class="breadcrumb">
        <li>财务管理</li><li class="active">支持列表</li>
    </ol>
</section>
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="hry-form-wrapper">
                <div class="box-header with-border" style="padding:15px;">
                    <h3 class="box-title"></h3>
					{include file="public/project_search5" /}
                </div>
                <div class="box-body table-responsive">
                    <table class="table table-bordered table-hover table-sort">
                        <tr>
                            <th>{$Think.lang.id}{:table_sort('id')}</th>
                            <th>订单号</th>
                            <th>会员名称</th>
                            <th>手机号</th>
                            <th>支持金额{:table_sort('target_code')}</th>
							<th>所属项目</th>
                            <th>状态</th>
                            <th>代付状态</th>
                            <th>代付备注</th>
                            <th>创建时间</th>
                            <th>操作</th>
                        </tr>
                        {volist name="dataList" id="vo"}
                        <tr>
							<td>{$vo.id}</td>
							<td>{$vo.order_sn}</td>
							<td>{$vo.username}</td>
							<td>{$vo.mobile}</td>
							<td>{$vo.money}</td>
							<td>{$vo.project_name}</td>
                            <td>{if condition="$vo.status eq 0"}未成功{elseif condition="$vo.status eq 2"}已成功{elseif condition="$vo.status eq 3"}已返本金{else /}进行中{/if}</td>
                            <td>{if condition="$vo.payment_status eq 0"}待处理{elseif condition="$vo.payment_status eq 1"}已成功{elseif condition="$vo.payment_status eq 2"}已失败{/if}</td>
                            <td>{$vo.payment_remark}</td>
							<td>{$vo.create_time}</td>
                            {if condition="($vo.status==2) AND ($vo.payment_status==0) AND ($vo.create_time>'2018-01-22') AND (($vo.project_id==31))"}
                            <td>
                                <a class="btn-text btn-primary btn-xs btnSubmit ss" data-id="{$vo.id}">代付</a></td>
                            {/if}
                        </tr>
                        {/volist}
                    </table>
                </div>
                <div class="box-footer clearfix">
                    {$dataList->render()}
                </div>
            </div>
        </div>
    </div>
</section>
</div>
<script type="text/javascript">
$(function(){
    /*ajax页面加载icheck，有该控件的页面才需要*/
    $('input[type="checkbox"].minimal, input[type="radio"].minimal').iCheck({
        checkboxClass: 'icheckbox_minimal-blue',
        radioClass: 'iradio_minimal-blue'
    });
	
    /*ajax页面加载icheck，有该控件的页面才需要*/
    $(".select2").select2({language:"zh-CN"});
    
    /*全选-反选*/
    $('.checkbox-toggle').on('ifChecked', function(event){
        var _this = $(this);
        var _table = _this.closest('.table');
        _table.find("tr td input[type='checkbox']").iCheck("check");
    });
    $('.checkbox-toggle').on('ifUnchecked', function(event){
        var _this = $(this);
        var _table = _this.closest('.table');
        _table.find("tr td input[type='checkbox']").iCheck("uncheck");
    });
    
    $('.editable').editable({
        emptytext: "empty",
        params: function(params) {      //参数
            var data = {};
            data['id'] = params.pk;
            data[params.name] = params.value;
            return data;
        },
        success: function(response, newValue) {
            var res = $.parseJSON( response );
            if(res.status == 1){
            }else{
                return res.info;
            }
        }
    });
    
    {if condition=" $rest_login == 1 "}
    restlogin('{$rest_login_info}');   //登录超时
    {/if}
})
$(".ss").on('click','', function(){
    data=$(this).data("id");
    $.ajax({
        url:"daifuz",
        data:{
            id:data
        },
        type:"POST",
        dataType:"json",
        success:function(JSON){
            console.log(JSON);
            $.amaran({'message':JSON.info})
            window.location.reload()
//                    debugger;
        },
        error:function(xhr,status,errorThrown){
//                    debugger;
        },
        complete:function(xhr,status){
//                    alert('The request is complated');
        },
        beforesend:function(){
        },
        cache:false,//true
        async:true
    });//ajax end here
});
</script>
{/block}
